package com.geek.novel.utils;

import java.io.Serializable;

public class HttpClientResult implements Serializable {
	private static final long serialVersionUID = 1L;

    public static int RESPONSE_CODE_SUCCESS = 200;
    public static int RESPONSE_CODE_ERROR = 500;

	/**
     * 响应状态码
     */
    private int code;

    /**
     * 响应数据
     */
    private String content;

    /**
     * 错误信息
     */
    private String message;

    private Exception exception;

    /**判断是否请求成功*/
    public boolean isSuccess(){
        return this.code == RESPONSE_CODE_SUCCESS;
    }

    
    public HttpClientResult() {
    }

    public HttpClientResult(int code, String content) {
    	this.code = code;
    	this.content = content;
    }
    
    public int getCode(){
    	return code;
    }
    public void setCode(int code) {
        this.code = code;
    }

    public String getContent(){
    	return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getMessage() {
        return message;
    }
    public void setMessage(String message) {
        this.message = message;
    }

    public Exception getException() {
        return exception;
    }
    public void setException(Exception exception) {
        this.exception = exception;
    }
}
